package cn.tonyandmoney.baidu.asr.event

import cn.tonyandmoney.baidu.asr.entity.NluResult
import cn.tonyandmoney.baidu.asr.recognizer.RecogResult
import com.google.gson.Gson

/**
 * asr 识别结果
 */
class AsrResultEvent(val code: Int,
                     val results: Array<String>?,
                     val result: RecogResult= RecogResult(),
                     val nluResult: NluResult=NluResult()) {

    companion object {
        const val CODE_FINAL = 0
        const val CODE_FINISH = 1
        const val CODE_PARTIAL = 10
        const val CODE_FINISH_ERROR = -1
        const val CODE_ERROR=-10
        const val CODE_STATE=20
    }


    override fun toString(): String {
        return Gson().toJson(this)
    }
}